import request from '@/utils/request'

// 厂家列表
export function fetchComList(params) {
  return request({
    url: '/operation/opBomCompany/queryList',
    method: 'get',
    params: {
      'id': params.id,
      'name': params.name,
      'pageIndex': params.pageIndex,
      'pageSize': params.pageSize
    },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// 厂家详情
export function fetchComDetail(id) {
  return request({
    url: '/operation/opBomCompany/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// 删除厂家
export function fetchComDelete(id) {
  return request({
    url: '/operation/opBomCompany/delete',
    method: 'delete',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqDelete'

  })
}

// 添加厂家
export function createComAdd(data) {
  return request({
    url: '/operation/opBomCompany/add',
    method: 'post',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPost'

  })
}

// 修改厂家
export function updateComArticle(data) {
  return request({
    url: '/operation/opBomCompany/update',
    method: 'put',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPut'

  })
}
